Fix create table ignoring solution parameter: send MSCRM.SolutionUniqueName header#191
Open
mstarodu wants to merge 1 commit into
Open
Fix create table ignoring solution parameter: send MSCRM.SolutionUniqueName header#191mstarodu wants to merge 1 commit into
mstarodu wants to merge 1 commit into
Conversation
CreateEntities was called with SolutionUniqueName as a URL query parameter, which Dataverse silently ignores, so new tables always landed in the Default solution. Pass the documented MSCRM.SolutionUniqueName request header instead (matching the existing relationship-creation code) in the sync, async, and batch code paths. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes create_table(..., solution=...) incorrectly passing SolutionUniqueName as an unsupported URL query option on the CreateEntities action (which Dataverse ignores), by sending the documented MSCRM.SolutionUniqueName request header instead. This aligns table creation behavior with existing relationship-creation behavior and ensures new tables land in the intended solution.
Changes:
- Update sync and async
_create_entityto sendMSCRM.SolutionUniqueNamevia request headers instead of URL query params. - Update
_build_create_entity(batch/raw-request path) to setMSCRM.SolutionUniqueNameon the_RawRequest.headersfield rather than appending to the URL. - Update unit tests (sync + async) to assert header behavior and ensure the URL no longer contains
SolutionUniqueName.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/PowerPlatform/Dataverse/data/_odata.py |
Sends MSCRM.SolutionUniqueName as a request header in the sync CreateEntities call path. |
src/PowerPlatform/Dataverse/aio/data/_async_odata.py |
Sends MSCRM.SolutionUniqueName as a request header in the async CreateEntities call path. |
src/PowerPlatform/Dataverse/data/_odata_base.py |
Updates the raw/batch request builder for CreateEntities to carry the solution as a header (not a URL query param). |
tests/unit/data/test_odata_internal.py |
Updates sync unit tests to validate header injection and ensure the URL does not include the solution query option. |
tests/unit/aio/data/test_async_odata_internal.py |
Updates async unit tests to validate header injection for solution-scoped entity creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
create_tablewithsolution=sentSolutionUniqueNameas a URL query parameter on theCreateEntitiesaction. Dataverse ignores unknown query options, so the request succeeded but the table always landed in the Default solution.Fix
Send the documented
MSCRM.SolutionUniqueNamerequest header instead (same mechanism relationship creation already uses) in sync, async, and batch code paths. Updated the 3 unit tests that asserted the query-param behavior.Ref: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/create-update-entity-definitions-using-web-api